package com.edu.udistrital.util;

import org.hibernate.HibernateException;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateUtil {

    private static final SessionFactory sessionFactory;   

    static { 
        try { 
            sessionFactory = new Configuration().configure().buildSessionFactory(); 
        } catch (HibernateException he) { 
           System.err.println("Initial SessionFactory creation failed. " + he); 
           throw new ExceptionInInitializerError(he); 
        } 
    }  

    public static SessionFactory getSessionFactory() { 
        return sessionFactory; 
    } 
}
